<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
	<title>添加回复语模板</title>
	<link rel="stylesheet" href="/layui/css/layui.css">
	<link rel="stylesheet" href="/fission/css/iconfont.css">
	<link rel="stylesheet" href="/fission/css/common.css">
	<style type="text/css">
		body{
			background: #f0f2f5;
			min-width: 1020px;
		}
		/*公共部分 start*/
		.public_header_container{
			height: 48px;
			background: #fff;
			display: -webkit-box;
			display: flex;
			-webkit-box-align: center;
			align-items: center;
			padding-left: 15px;
			border-bottom: 1px solid #e8e8e8;
		}
		.public_header_container p{
			font-size: 16px;
			font-weight: 500;
			color: rgba(0,0,0,.85);
			line-height: 28px;
		}
		.public_main_container{
			padding: 16px;
		}
		.public_main_content{
			background: #fff;
			padding: 24px;
		}
		.public_firstTitle_container{
			display: flex;
			align-items: center;
		}
		.customerInfo_firstTitle{
			font-weight: 700;
			font-size: 15px;
			margin-right: 12px;
		}
		.customerInfo_secendTitle{
			margin-top: 20px;
			margin-bottom: 8px;
			color: rgba(0,0,0,.65);
			font-size: 14px;
		}
		.line{
			width: 100%;
			height: 1px;
			background: #ececec;
			margin-top: 20px;
			margin-bottom: 32px;
		}
		.customerInfo_button{
			border: 1px solid #1890ff;
			color: #1890ff;
			width: 74px;
			padding: 0;
			height: 30px;
			display: flex;
			align-items: center;
			justify-content: center;
			margin-top: 16px;
			outline: none;
			appearance: none;
			background: #fff;
			line-height: 30px;
			border-radius: 2px;
			cursor: pointer;
		}
		.public_Control_container{
			display: flex;
			align-items: center;
			cursor: pointer;
		}
		.public_Control_container svg{
			width: 15px;
			height: 15px;
			margin-right: 4px;
		}
		.public_Control_container span{
			font-size: 14px;
			font-weight: 400;
			color: rgba(0,0,0,.85);
		}
		.customerInfo_publicLable{
			height: 30px;
			padding: 0 10px;
			background: #f6f6f6;
			border-radius: 4px;
			border: 1px solid #eee;
			display: flex;
			align-items: center;
			justify-content: center;
			color: rgba(0,0,0,.65);
			min-width: 51px;
		}
		.customerInfo_publicLable svg{
			width: 14px;
			height: 14px;
			margin-right: 9px;
		}
		.customerInfo_publicLable span{

		}
		.color-blue{
			color: #1890ff !important;
		}
		.public_RightShowcased_container{
			height: 38px;
			line-height: 38px;
			border-width: 1px;
			border-style: solid;
			border-color: #e6e6e6;
			background-color: #fff;
			border-radius: 2px;
			box-sizing: border-box;
			padding-left: 10px;
			overflow: hidden;		
		}
		.public_RightShowcased_container li{
			height: 36px;
			line-height: 36px;
			float: left;
		}
		.cursor-pointer{
			cursor: pointer;
		}
		/*公共部分 end*/
		/*客户信息设置内容区域 start*/
		.customerInfo_container{
			display: flex;
		}
		.customerInfo_left_container{
			flex: 1;
		}
		.customerInfo_right_container{
			width: 360px;
			margin-left: 97px;
			margin-right: 49px;
		}
		.customerInfo_right_container h4{
			color: rgba(0,0,0,.65);
			font-size: 14px;
			text-align: center;
			margin-bottom: 20px;
		}
		.customerInfo_rightImg_container{
			width: 328px;
			background: #f4f4f4;
			padding: 12px;
		}
		.customerInfo_rightImg_container img{
			width: 328px;
			height: 620px;
		}
		.customerInfo_left_content{

		}
		.customerInfo_titleControl_container{
			display: flex;
			align-items: center;
			margin-left: 12px;
			
		}
		.customerInfo_titleControl_container svg{
			width: 15px;
			height: 15px;
			margin-right: 4px;
		}
		.customerInfo_titleControl_container span{

		}
		.customerInfo_publicLable_container{
			overflow: hidden;

		}
		.customerInfo_publicLable_container li{
			float: left;
			margin-right: 10px;
			margin-bottom: 12px;
		}
		.customerInfo_publicLable_container li svg{
			width: 14px;
			height: 14px;
		}
		.customerInfo_publicLable_container li span{

		}
		.customize_info_list_container{

		}
		.customize_info_list_container li{
			display: flex;
			align-items: center;
			margin-top: 12px;
		}
		.customize_info_listLeft_container{
			width: 115px;
			display: flex;
			margin-right: 16px;
		}
		.customize_info_listControl_container{
			display: flex;
			align-items: center;
			flex: 1;
		}
		.customize_info_listControl_container li{
			margin-top: 0;
			padding: 0 10px;
			border-right: 1px solid #ececec;
		}
		.customize_info_listControl_container li:last-child{
			border-right: none;
		}
		/*客户信息设置内容区域 end*/
		/*标签部分*/
		.customerLabel_mainList_content{
			flex: 1;
			padding-right: 245px;
			display: flex;
			-webkit-box-align: center;
			align-items: center;
			flex-wrap: wrap;
			padding-top: 5px;
		}
		.customerLabel_mainList_content li{

			height: 28px;
			display: -webkit-box;
			display: flex;
			-webkit-box-pack: center;
			justify-content: center;
			-webkit-box-align: center;
			align-items: center;
			padding-left: 14px;
			padding-right: 14px;
			border: 1px solid #e9e9e9;
			color: rgba(0,0,0,.65);
			font-size: 14px;
			background: #f7f7f7;
			/*border-radius: 4px;*/
			margin-right: 10px;
			margin-bottom: 10px;
			position: relative;
		}
		.add_active{
			background: #fff !important;
			box-shadow: 0 2px 0 rgba(0,0,0,.015) !important;
			cursor: pointer;
		}
		.add_active:hover{
			border-color: #40a9ff;
			color: #40a9ff;
			transition: all .3s
		}
		.inputLable{
			height: 28px;
			margin-bottom: 10px;
			outline: none;
			background: #fff;
			border: 1px solid #ececec;
			/*border-radius: 5px;*/
			padding: 0 10px;
			width: 111px;
			margin-right: 10px;
		}
		.inputLable:focus{
			border-color: #40a9ff;
		}
		.deleteLabel{
			position: absolute;
			width: 10px;
			height: 10px;
			right: -5px;
			top: -4px;
			background: #a2a2a2;
			border-radius: 50%;
			padding: 2px;
			cursor: pointer;
		}
		/*类型部分*/
		.public_form_List{
			margin-bottom: 10px;
		}
		.public_form_List:last-child{
			margin-bottom: 0px;
		}
		/*新加的设置回复信息里选择 菜单 start*/
		.addKeywordMenuList_continaer{

		}
		.addKeywordMenuList_continaer li{
			display: flex;
			align-items: center;
			margin-bottom: 15px;
			width: 120px;
		}
		.addKeywordMenuList_left_continaer{
			display: flex;
			align-items: center;
		}
		.addKeywordMenuList_leftSelect_continaer{
			width: 120px;
		}
		.addKeywordMenuList_leftInput_continaer{
			display: flex;
			align-items: center;
		}
		.addKeywordMenuList_right_continaer{
			margin-left: 20px;
		}
		.addKeywordMenuList_AddButton_container{
			
		}
		/*新加的设置回复信息里选择 菜单 end */
	</style>
</head>
<body>
	<!-- 新版公共头部 -->
	<div class="public_header_container">
		<p>创建规则</p>
	</div>
	<!-- 新公共内容区域 -->
	<form class="layui-form" action="" id="addAutomatictag">
		<div class="public_main_container">
			<div class="public_main_content">
				<h3 class="customerInfo_firstTitle">创建规则</h3>
				<input type="hidden" name="" value="{$keyword->id}" id="id">
				<div class="line"></div>
				<div class="layui-form-item" style="margin-bottom: 0;">
					<label class="layui-form-label">回复方式</label>
					<div class="layui-input-block" style="width: 150px;">
						<div class="public_RightShowcased_container">
							<span style="font-weight: bold;">自动回复</span>
						</div>
					</div>
					<div class="layui-input-block">
						<p style="color: #999">根据客户发送的信息，模糊或精准匹配，自动回复相应信息</p>
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label">规则名称</label>
					<div class="layui-input-block" style="width: 500px;">
						<input type="text" name="name" required  value="{$keyword->name}" lay-verify="required" placeholder="请输入标题" autocomplete="off" class="layui-input">
					</div>
				</div>
				<h3 class="customerInfo_firstTitle">匹配规则</h3>
				<div class="line"></div>
				<div class="layui-form-item">
					<div class="public_form_List">
						<div class="public_formTitle_container">
							<lable class="layui-form-label">匹配方式：</lable>
						</div>
						<div class="public_formOther_container">
							<div class="layui-input-block" id="shareuser">
								<input type="radio" lay-filter="shareuser" name="shareuser" value="1" title="通用" {if !$keyword->id}checked{/if} {if $keyword->types == 1}checked{/if}>
								<input type="radio" lay-filter="shareuser" name="shareuser" value="2" title="按客服"  {if $keyword->types == 2}checked{/if}>
							</div>
						</div>
					</div>
					<div class="public_form_List shareuser" id="seleatLable" {if $keyword->types == 1 }style="display: none; margin-bottom: 0;" {/if}>
						<div class="public_formTitle_container">
							<lable class="layui-form-label">选择客服：</lable>
						</div>
						<div class="public_formOther_container">
							<div class="layui-input-block">
								<span class="layui-btn layui-btn-primary" id="addPeople">+ 前往添加</span>
							</div>
						</div>
						<input type="hidden" name="checkUser" id="checkUser" value="{implode(',',json_decode($keyword->users,1))}" />
						<div id="checkUserCon" style="padding: 10px 0px 0px 105px;">
							{loop json_decode($keyword->users,1) as $userid}
					        	<div class="service-card">
						        	<i class="iconfont icon-person"></i>{$this->get_user_name($userid)}
						        </div>
					      	{/loop}
						</div>
					</div>
				</div>
				<h3 class="customerInfo_firstTitle">设置关键词</h3>
				<div class="line"></div>
				<div class="layui-form-item">
					<label class="layui-form-label">模糊匹配</label>
					<div class="layui-input-block">
						<input type="hidden" name="fuzzyMatch" id="fuzzyMatch" value="{implode(',',$keyword->fuzzy_match_words)}">
						<ul class="customerLabel_mainList_content fuzzyMatch">
							<li class="add_active">+ 添加</li>
							<input class="inputLable" type="text" name="" placeholder="输入后回车" style="display: none;">
							<!-- 循环 -->
							{loop $keyword->fuzzy_match_words as $fuzzy}
							<li>
								<span>{$fuzzy}</span>
								<svg class="deleteLabel" t="1614329734901" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2344" width="30" height="30"><path d="M604.672 523.776l364.544-364.544c25.088-25.088 25.088-66.048 0-90.624l-2.048-2.048c-12.288-12.288-28.16-18.944-45.568-18.944s-33.28 6.656-45.568 18.944L512 431.616 147.456 66.56c-12.288-12.288-28.16-18.944-45.568-18.944-17.408 0-33.28 6.656-45.568 18.944l-2.048 2.048c-12.288 12.288-19.456 28.16-19.456 45.568s6.656 33.28 18.944 45.568l364.544 364.544L53.76 888.832c-25.088 25.088-25.088 66.048 0 90.624l2.048 2.048c12.288 12.288 28.16 18.944 45.568 18.944 17.408 0 33.28-6.656 45.568-18.944L511.488 616.96l364.544 364.544c12.288 12.288 28.16 18.944 45.568 18.944s33.28-6.656 45.568-18.944l2.048-2.048c12.288-12.288 18.944-28.16 18.944-45.568 0-17.408-6.656-33.28-18.944-45.568L604.672 523.776z" p-id="2345" fill="#fff"></path></svg>
							</li>
							{/loop}
						</ul>
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label">精准匹配</label>
					<div class="layui-input-block">
						<input type="hidden" name="preciseMatch" id="preciseMatch" value="{implode(',',$keyword->precise_match_words)}">
						<ul class="customerLabel_mainList_content preciseMatch">
							<li class="add_active">+ 添加</li>
							<input class="inputLable" type="text" name="" placeholder="输入后回车" style="display: none;">
							<!-- 循环 -->
							{loop $keyword->precise_match_words as $precise}
							<li>
								<span>{$precise}</span>
								<svg class="deleteLabel" t="1614329734901" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2344" width="30" height="30"><path d="M604.672 523.776l364.544-364.544c25.088-25.088 25.088-66.048 0-90.624l-2.048-2.048c-12.288-12.288-28.16-18.944-45.568-18.944s-33.28 6.656-45.568 18.944L512 431.616 147.456 66.56c-12.288-12.288-28.16-18.944-45.568-18.944-17.408 0-33.28 6.656-45.568 18.944l-2.048 2.048c-12.288 12.288-19.456 28.16-19.456 45.568s6.656 33.28 18.944 45.568l364.544 364.544L53.76 888.832c-25.088 25.088-25.088 66.048 0 90.624l2.048 2.048c12.288 12.288 28.16 18.944 45.568 18.944 17.408 0 33.28-6.656 45.568-18.944L511.488 616.96l364.544 364.544c12.288 12.288 28.16 18.944 45.568 18.944s33.28-6.656 45.568-18.944l2.048-2.048c12.288-12.288 18.944-28.16 18.944-45.568 0-17.408-6.656-33.28-18.944-45.568L604.672 523.776z" p-id="2345" fill="#fff"></path></svg>
							</li>
							{/loop}
						</ul>
					</div>
				</div>
				<h3 class="customerInfo_firstTitle">设置回复信息</h3>
				<div class="line"></div>
				<div class="layui-form-item">
					<label class="layui-form-label">选择类型</label>
					<div class="layui-input-block" style="width: 300px;">
						<select value="{$keyword->type}" name="type" lay-filter="shareType" id="shareType">
							{foreach $type as $k => $t}
								<option value="{$k}" {if $k == $keyword->type}selected{/if}>{$t}</option>
							{/foreach}
						</select>
					</div>
				</div>
				<!-- 文本 -->
				<div class="public_form_List publicHide_content" id="text"  {if $keyword->type != 1} style="display: none;" {/if}>
					<div class="public_formTitle_container">
						<lable class="layui-form-label">文本：</lable>
					</div>
					<div class="public_formOther_container">
						<div class="layui-input-block">
						  <textarea name="text_content" value="{$keyword->data['text_content']}" id="text_content" placeholder="请输入内容" class="layui-textarea">{$keyword->data['text_content']}</textarea>
						</div>
					</div>
				</div>
				<!-- 图片 -->
				<div class="public_form_List publicHide_content" id="imgcontainer" {if $keyword->type != 2} style="display: none;" {/if}>
					<div class="public_formTitle_container">
						<lable class="layui-form-label">图片：</lable>
					</div>
					<div class="public_formOther_container">
						<div class="layui-input-block">
							<img onerror="this.style.display='none'" id="pic_image" src="{$keyword->data['image_url']}" style="width: 100px; height: 100px;">
							<input type="hidden" name="image" value="{$keyword->data['image_url']}" id="image" />
							<button type="button" class="layui-btn select_img" data-target="image">
							  <i class="layui-icon">&#xe67c;</i>上传图片
							</button>

						</div>
					</div>
				</div>
				<!-- 图文 -->
					<div class="public_form_List publicHide_content" id="imgtextcontainer" {if $keyword->type != 3} style="display: none;" {/if}>
						<div class="public_form_List">
							<div class="public_formTitle_container">
								<lable class="layui-form-label">标题：</lable>
							</div>
							<div class="public_formOther_container">
								<div class="layui-input-block">
									<input type="text" name="link_title" value="{$keyword->data['link_title']}" id="link_title" placeholder="请输入标题" autocomplete="off" class="layui-input">
								</div>
							</div>
						</div>
						
						<div class="public_form_List">
							<div class="public_formTitle_container">
								<lable class="layui-form-label">链接：</lable>
							</div>
							<div class="public_formOther_container">
								<div class="layui-input-block">
									<input type="text" name="link_url" value="{$keyword->data['link_url']}" id="link_url" placeholder="请输入链接" autocomplete="off" class="layui-input">
								</div>
							</div>
						</div>

						<div class="public_form_List">
							<div class="public_formTitle_container">
								<lable class="layui-form-label">封面：</lable>
							</div>
							<div class="public_formOther_container">
								<div class="layui-input-block">
									<img onerror="this.style.display='none'" id="pic_link_pic" src="{$keyword->data['link_picurl']}" style="width: 100px; height: 100px;">
									<input type="hidden" name="link_pic" value="{$keyword->data['link_picurl']}" id="link_pic" />
									<button type="button" class="layui-btn select_img" data-target="link_pic">
									  <i class="layui-icon">&#xe67c;</i>上传图片
									</button>

								</div>
							</div>
						</div>
						
						<div class="public_form_List">
							<div class="public_formTitle_container">
								<lable class="layui-form-label">描述：</lable>
							</div>
							<div class="public_formOther_container">
								<div class="layui-input-block">
									<input type="text" name="link_desc" value="{$keyword->data['link_desc']}" id="link_desc"   placeholder="请输入描述" autocomplete="off" class="layui-input">
								</div>
							</div>
						</div>
					</div>

					<!-- 小程序 -->
					<div class="public_form_List publicHide_content" id="xcxcontainer" {if $keyword->type != 4} style="display: none;" {/if}>

						<div class="public_form_List">
							<div class="public_formTitle_container" >
								<lable class="layui-form-label" style="width: 100px;">小程序名称：</lable>
							</div>
							<div class="public_formOther_container">
								<div class="layui-input-block">
									<input type="text" name="miniprogram_name" style="width:90%" value="{$keyword->data['miniprogram_name']}" id="miniprogram_name"   placeholder="请输入小程序名称" autocomplete="off" class="layui-input">
								</div>
							</div>
						</div>

						<div class="public_form_List">
							<div class="public_formTitle_container">
								<lable class="layui-form-label" style="width: 100px;">小程序ID：</lable>
							</div>
							<div class="public_formOther_container">
								<div class="layui-input-block">
									<input type="text" name="miniprogram_appid" style="width:90%" value="{$keyword->data['miniprogram_appid']}" id="miniprogram_appid"   placeholder="请输入ID" autocomplete="off" class="layui-input">
								</div>
							</div>
						</div>
							
						<div class="public_form_List">
							<div class="public_formTitle_container" >
								<lable class="layui-form-label" style="width: 100px;">小程序路径：</lable>
							</div>
							<div class="public_formOther_container">
								<div class="layui-input-block">
									<input type="text" name="miniprogram_page" style="width:90%" value="{$keyword->data['miniprogram_page']}" id="miniprogram_page"    placeholder="请输入小程序路径" autocomplete="off" class="layui-input">
								</div>
							</div>
						</div>

						<div class="public_form_List">
							<div class="public_formTitle_container" >
								<lable class="layui-form-label" style="width: 100px;">小程序标题：</lable>
							</div>
							<div class="public_formOther_container">
								<div class="layui-input-block">
									<input type="text" name="miniprogram_title" style="width:90%" value="{$keyword->data['miniprogram_title']}" id="miniprogram_title"  placeholder="请输入标题" autocomplete="off" class="layui-input">
								</div>
							</div>
						</div>
						
						<div class="public_form_List">
							<div class="public_formTitle_container" >
								<lable class="layui-form-label" style="width: 100px;">小程序封面：</lable>
							</div>
							<div class="public_formOther_container">
								<div class="layui-input-block">
									<img onerror="this.style.display='none'" id="pic_miniprogram_pic" src="{$keyword->data['miniprogram_url']}" style="width: 100px; height: 100px;">
									<input type="hidden" name="miniprogram_pic" style="width:90%" value="{$keyword->data['miniprogram_url']}" id="miniprogram_pic" />
									<button type="button" class="layui-btn select_img" data-target="miniprogram_pic">
									  <i class="layui-icon">&#xe67c;</i>上传图片
									</button>

								</div>
							</div>
						</div>
					</div>
					<!-- 语音 -->
					<div class="public_form_List publicHide_content" id="vioceDiv" {if $keyword->type != 5} style="display: none;" {/if}>
						<div class="public_formTitle_container">
							<lable class="layui-form-label">语音：</lable>
						</div>
						<div class="public_formOther_container">
							<div class="layui-input-block">
								<input type="hidden" name="vioce_url" id="vioce_url" value="{$keyword->data['vioce_url']}" />
								<input type="hidden" name="vioce_name" id="vioce_name" value="{$keyword->data['vioce_name']}" />
								<button type="button" class="layui-btn" id="uploadVioce">
								  <i class="layui-icon">&#xe67c;</i>上传语音文件
								</button>
								<div class="layui-form-mid layui-word-aux" id="vioce_name_show">{$keyword->data['vioce_url']}</div>
							</div>
						</div>
					</div>
					<!-- 视频 -->
					<div class="public_form_List publicHide_content" id="videoDiv" {if $keyword->type != 6} style="display: none;" {/if}>
						<div class="public_formTitle_container">
							<lable class="layui-form-label">视频：</lable>
						</div>
						<div class="public_formOther_container">
							<div class="layui-input-block">
								<input type="hidden" name="video_url" id="video_url" value="{$keyword->data['video_url']}" />
								<input type="hidden" name="video_name" id="video_name" value="{$keyword->data['video_name']}" />
								<button type="button" class="layui-btn" id="uploadVideo">
								  <i class="layui-icon">&#xe67c;</i>上传视频文件
								</button>
								<div class="layui-form-mid layui-word-aux" id="video_name_show">{$keyword->data['video_url']}</div>
							</div>
						</div>
					</div>
					<!-- 文件 -->
					<div class="public_form_List publicHide_content" id="fileDiv" {if $keyword->type != 7} style="display: none;" {/if}>
						<div class="public_formTitle_container">
							<lable class="layui-form-label">文件：</lable>
						</div>
						<div class="public_formOther_container">
							<div class="layui-input-block">
								<input type="hidden" name="file_url" id="file_url" value="{$keyword->data['file_url']}"/>
								<input type="hidden" name="file_name" id="file_name" value="{$keyword->data['file_name']}" />

								<button type="button" class="layui-btn" id="uploadFile">
								  <i class="layui-icon">&#xe67c;</i>上传文件
								</button>
								<div class="layui-form-mid layui-word-aux" id="file_name_show">{$keyword->data['file_url']}</div>
							</div>
						</div>
					</div>
					<!-- 菜单 -->
					<div class="public_form_List publicHide_content" id="menuDiv" {if $keyword->type != 8} style="display: none;" {/if}>
						<div class="layui-form-item">
							<label class="layui-form-label">顶部文字</label>
							<div class="layui-input-block" style="width: 500px;">
								<input type="text" name="topText" id="topText" value="{$keyword->toptext}" placeholder="请输入顶部文字" autocomplete="off" class="layui-input">
							</div>
						</div>

						<div class="layui-form-item">
							<label class="layui-form-label">菜单列表</label>
							<div class="layui-input-block">
								<ul class="addKeywordMenuList_continaer">
									{if !$keyword->menu}
										<li>
											<div class="addKeywordMenuList_left_continaer">
												<div class="addKeywordMenuList_leftSelect_continaer">
													<select name="menuType0" lay-filter="menuType">
													  <option value="0">点击菜单</option>
													  <option value="1">跳转网址</option>
													</select>
												</div>
												<div class="addKeywordMenuList_leftInput_continaer">
													<div class="layui-input-block inputMenuName" style="width: 300px; margin-left: 20px;">
														<input type="text" name="minText0" id="minText" value="" placeholder="请输入内容" autocomplete="off" class="layui-input">
													</div>
													<div class="layui-input-block inputMenuLink" style="width: 300px; margin-left: 20px; display:none;">
														<input type="text" name="topurl0"value="" placeholder="请输入网址" autocomplete="off" class="layui-input">
													</div>
												</div>
											</div>
											<div class="addKeywordMenuList_right_continaer">
												<button type="button" class="layui-btn layui-btn-danger removeList" data-id="0">删除</button>
											</div>
										</li>
									{else}
										{loop $keyword->menu as $key=>$menu}
											<li>
												<div class="addKeywordMenuList_left_continaer">
													<div class="addKeywordMenuList_leftSelect_continaer">
														<select name="menuType{$key}" lay-filter="menuType">
														  <option value="0" {if $menu['type'] == 0}selected{/if}>点击菜单</option>
														  <option value="1" {if $menu['type'] == 1}selected{/if}>跳转网址</option>
														</select>
													</div>
													<div class="addKeywordMenuList_leftInput_continaer">
														<div class="layui-input-block inputMenuName" style="width: 300px; margin-left: 20px;">
															<input type="text" name="minText{$key}" required  value="{$menu['text']}" {if $keyword->type == 8} lay-verify="required" {/if} placeholder="请输入内容" autocomplete="off" class="layui-input">
														</div>
														<div class="layui-input-block inputMenuLink" {if $menu['type'] == 0}style="width: 300px; margin-left: 20px;display:none;"{else}style="width: 300px; margin-left: 20px;"  {/if} >
															<input type="text" name="topurl{$key}" value="{$menu['url']}" placeholder="请输入网址" autocomplete="off" class="layui-input">
														</div>
													</div>
												</div>
												<div class="addKeywordMenuList_right_continaer">
													<button type="button" class="layui-btn layui-btn-danger removeList" data-id="{$key}">删除</button>
												</div>
											</li>
										{/loop}
									{/if}
								</ul>
								<div class="addKeywordMenuList_AddButton_container">
									<button type="button" class="layui-btn layui-btn-primary addKeywordMenuList_AddButton">添加菜单</button>
								</div>
							</div>
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label">底部文字</label>
							<div class="layui-input-block" style="width: 500px;">
								<input type="text" name="downText" id="downText" value="{$keyword->buttext}" placeholder="请输入底部文字" autocomplete="off" class="layui-input">
							</div>
						</div>
					</div>
					<div class="public_form_List publicHide_content" id="positionDiv" {if $keyword->type != 9} style="display: none;" {/if}>
						<div class="layui-form-item selectAddress">
				            	<label class="layui-form-label">地图坐标：</label>
				            <div class="layui-input-inline" style="width: 100px;">
				                <input type="text" name="position_lng" id="lng" placeholder="" value="{$keyword->data['longitude']}" autocomplete="off" class="layui-input">
				            </div>
				            <div class="layui-form-mid">-</div>
				            <div class="layui-input-inline" style="width: 100px;">
				                <input type="text" name="position_lat" id="lat" placeholder="" value="{$keyword->data['latitude']}" autocomplete="off" class="layui-input">
				            </div>
				        </div>
				        <div class="layui-form-item selectAddress">
				            <label class="layui-form-label">地址：</label>
				            <div class="layui-input-inline">
				                <input type="text" id="position_address" name="address" value="{$keyword->data['name']}" autocomplete="off" class="layui-input" data-rule-maxlength ="140"/>
				                
				            </div>
				            <div class="layui-form-mid layui-word-aux"><a href="javascript:;" style="color: blue;" onclick="codeAddress()">搜索坐标</a></div>
				        </div>
				        <div class="layui-form-item selectAddress">
				            <div class="layui-form-label">地址详情：</div>
				            <div class="layui-input-inline" style="width: 300px;">
				                <input type="text" class="layui-input" id="position_detail"  name="position_detail" value="{$keyword->data['address']}" placeholder="请输入地址详情">
				            </div>
				        </div>
				        <div class="layui-form-item selectAddress">
				            <label class="layui-form-label"></label>
				            <div class="" id="container" style="max-width:600px;min-height:300px;"></div>
				        </div>
					</div>


				<div class="layui-form-item">
				    <div class="layui-input-block">
				      <button type="button" class="layui-btn" lay-submit lay-filter="addAutomatictag">立即提交</button>
				    </div>
				  </div> 
			</div>
		</div>
	</form>
	<script src="/cdn/jquery.js"></script>
	<script src="/layui/layui.js"></script>
	<script src="/js/ajax.js"></script>
	<script charset="utf-8" src="https://map.qq.com/api/js?v=2.exp&key=MLGBZ-2TG32-6KOUF-CIOJ6-BENLJ-Z5BHQ"></script>
	<script type="text/javascript">
		$('#addPeople').on('click',function(){
			if('{$keyword->users}'){
				layer.open({
					type: 2,
					title: '请选择人员',
					shadeClose: true,
					shade: 0.2,
					area: ['700px', '530px'],
					content: 'select_kf-{$keyword->id}-2.html'
				}); 
			}else{
				layer.open({
				  	type: 2,
				  	title: '请选择人员',
				  	shadeClose: true,
				  	shade: 0.2,
				  	area: ['700px', '530px'],
				  	content: 'select_kf.html'
				}); 
			}
			
		})
		window.onload=function(){
			if("{$keyword->type}"){
				if ("{$keyword->type}" == "1") {
					$('#image').removeAttr("lay-verify");
					$('#link_title').removeAttr("lay-verify");
					$('#miniprogram_page').removeAttr("lay-verify");
					$('#miniprogram_name').removeAttr("lay-verify");
					$('#link_url').removeAttr("lay-verify");
					$('#miniprogram_appid').removeAttr("lay-verify");
					$('#miniprogram_title').removeAttr("lay-verify");
					$('#miniprogram_pic').removeAttr("lay-verify");
					$('#topText').removeAttr("lay-verify");
					$('#downText').removeAttr("lay-verify");
					$('#vioce_url').removeAttr("lay-verify");
					$('#video_url').removeAttr("lay-verify");
					$('#file_url').removeAttr("lay-verify");
					$('#link_desc').removeAttr("lay-verify");
					$('#lat').removeAttr("lay-verify");
					$('#lng').removeAttr("lay-verify");
					$('#position_address').removeAttr("lay-verify");
					$('#position_detail').removeAttr("lay-verify");
					$('#minText').removeAttr("lay-verify");
					$('#link_pic').removeAttr("lay-verify");
					$('#text_content').attr("lay-verify","required");
		            $(".publicHide_content").hide();
		            $("#text").show();
		        }else if("{$keyword->type}" == "2"){
					$('#text_content').removeAttr("lay-verify");
					$('#link_title').removeAttr("lay-verify");
					$('#miniprogram_page').removeAttr("lay-verify");
					$('#miniprogram_name').removeAttr("lay-verify");
					$('#minText').removeAttr("lay-verify");
					$('#link_url').removeAttr("lay-verify");
					$('#miniprogram_appid').removeAttr("lay-verify");
					$('#miniprogram_title').removeAttr("lay-verify");
					$('#miniprogram_pic').removeAttr("lay-verify");
					$('#vioce_url').removeAttr("lay-verify");
					$('#video_url').removeAttr("lay-verify");
					$('#topText').removeAttr("lay-verify");
					$('#downText').removeAttr("lay-verify");
					$('#file_url').removeAttr("lay-verify");
					$('#image').attr("lay-verify","required");
					$('#link_desc').removeAttr("lay-verify");
					$('#link_pic').removeAttr("lay-verify");
					$('#lat').removeAttr("lay-verify");
					$('#lng').removeAttr("lay-verify");
					$('#position_address').removeAttr("lay-verify");
					$('#position_detail').removeAttr("lay-verify");
		        	$(".publicHide_content").hide();
		        	$("#imgcontainer").show();
		        }else if("{$keyword->type}" == "3"){
					$('#text_content').removeAttr("lay-verify");
					$('#image').removeAttr("lay-verify");
					$('#miniprogram_page').removeAttr("lay-verify");
					$('#miniprogram_name').removeAttr("lay-verify");
					$('#miniprogram_appid').removeAttr("lay-verify");
					$('#miniprogram_title').removeAttr("lay-verify");
					$('#topText').removeAttr("lay-verify");
					$('#downText').removeAttr("lay-verify");
					$('#miniprogram_pic').removeAttr("lay-verify");
					$('#lat').removeAttr("lay-verify");
					$('#lng').removeAttr("lay-verify");
					$('#position_address').removeAttr("lay-verify");
					$('#position_detail').removeAttr("lay-verify");
					$('#vioce_url').removeAttr("lay-verify");
					$('#video_url').removeAttr("lay-verify");
					$('#file_url').removeAttr("lay-verify");
					$('#link_title').attr("lay-verify","required");
					$('#link_url').attr("lay-verify","required");
					$('#minText').removeAttr("lay-verify");
					$('#link_pic').attr("lay-verify","required");
					$('#link_desc').attr("lay-verify","required");
		        	$(".publicHide_content").hide();
		        	$("#imgtextcontainer").show();
		        }else if("{$keyword->type}" == "4"){
					$('#text_content').removeAttr("lay-verify");
					$('#image').removeAttr("lay-verify");
					$('#link_title').removeAttr("lay-verify");
					$('#link_url').removeAttr("lay-verify");
					$('#vioce_url').removeAttr("lay-verify");
					$('#video_url').removeAttr("lay-verify");
					$('#link_desc').removeAttr("lay-verify");
					$('#link_pic').removeAttr("lay-verify");
					$('#topText').removeAttr("lay-verify");
					$('#downText').removeAttr("lay-verify");
					$('#file_url').removeAttr("lay-verify");
					$('#miniprogram_appid').attr("lay-verify","required");
					$('#miniprogram_title').attr("lay-verify","required");
					$('#lat').removeAttr("lay-verify");
					$('#lng').removeAttr("lay-verify");
					$('#position_address').removeAttr("lay-verify");
					$('#position_detail').removeAttr("lay-verify");
					$('#miniprogram_pic').attr("lay-verify","required");
					$('#minText').removeAttr("lay-verify");
					$('#miniprogram_page').attr("lay-verify","required");
					$('#miniprogram_name').attr("lay-verify","required");
		        	$(".publicHide_content").hide();
		        	$("#xcxcontainer").show();
		        }else if("{$keyword->type}" == "5"){
					$('#text_content').removeAttr("lay-verify");
					$('#image').removeAttr("lay-verify");
					$('#link_title').removeAttr("lay-verify");
					$('#link_url').removeAttr("lay-verify");
					$('#vioce_url').attr("lay-verify","required");
					$('#link_desc').removeAttr("lay-verify");
					$('#link_pic').removeAttr("lay-verify");
					$('#miniprogram_page').removeAttr("lay-verify");
					$('#miniprogram_name').removeAttr("lay-verify");
					$('#video_url').removeAttr("lay-verify");
					$('#topText').removeAttr("lay-verify");
					$('#downText').removeAttr("lay-verify");
					$('#file_url').removeAttr("lay-verify");
					$('#miniprogram_appid').removeAttr("lay-verify");
					$('#lat').removeAttr("lay-verify");
					$('#lng').removeAttr("lay-verify");
					$('#position_address').removeAttr("lay-verify");
					$('#position_detail').removeAttr("lay-verify");
					$('#minText').removeAttr("lay-verify");
					$('#miniprogram_title').removeAttr("lay-verify");
					$('#miniprogram_pic').removeAttr("lay-verify");
		        	$(".publicHide_content").hide();
		        	$("#vioceDiv").show();
		        }else if("{$keyword->type}" == "6"){
					$('#text_content').removeAttr("lay-verify");
					$('#image').removeAttr("lay-verify");
					$('#link_title').removeAttr("lay-verify");
					$('#link_url').removeAttr("lay-verify");
					$('#vioce_url').removeAttr("lay-verify");
					$('#link_desc').removeAttr("lay-verify");
					$('#link_pic').removeAttr("lay-verify");
					$('#video_url').attr("lay-verify","required");
					$('#file_url').removeAttr("lay-verify");
					$('#miniprogram_page').removeAttr("lay-verify");
					$('#miniprogram_name').removeAttr("lay-verify");
					$('#miniprogram_appid').removeAttr("lay-verify");
					$('#topText').removeAttr("lay-verify");
					$('#minText').removeAttr("lay-verify");
					$('#lat').removeAttr("lay-verify");
					$('#lng').removeAttr("lay-verify");
					$('#position_address').removeAttr("lay-verify");
					$('#position_detail').removeAttr("lay-verify");
					$('#downText').removeAttr("lay-verify");
					$('#miniprogram_title').removeAttr("lay-verify");
					$('#miniprogram_pic').removeAttr("lay-verify");
		        	$(".publicHide_content").hide();
		        	$("#videoDiv").show();
		        }else if("{$keyword->type}" == "7"){
					$('#text_content').removeAttr("lay-verify");
					$('#image').removeAttr("lay-verify");
					$('#link_title').removeAttr("lay-verify");
					$('#link_url').removeAttr("lay-verify");
					$('#link_desc').removeAttr("lay-verify");
					$('#link_pic').removeAttr("lay-verify");
					$('#vioce_url').removeAttr("lay-verify");
					$('#video_url').removeAttr("lay-verify");
					$('#file_url').attr("lay-verify","required");
					$('#miniprogram_page').removeAttr("lay-verify");
					$('#miniprogram_name').removeAttr("lay-verify");
					$('#miniprogram_appid').removeAttr("lay-verify");
					$('#miniprogram_title').removeAttr("lay-verify");
					$('#miniprogram_pic').removeAttr("lay-verify");
					$('#minText').removeAttr("lay-verify");
					$('#topText').removeAttr("lay-verify");
					$('#lat').removeAttr("lay-verify");
					$('#lng').removeAttr("lay-verify");
					$('#position_address').removeAttr("lay-verify");
					$('#position_detail').removeAttr("lay-verify");
					$('#downText').removeAttr("lay-verify");
		        	$(".publicHide_content").hide();
		        	$("#fileDiv").show();
		        }else if("{$keyword->type}" == "8"){
					$('#text_content').removeAttr("lay-verify");
					$('#image').removeAttr("lay-verify");
					$('#link_title').removeAttr("lay-verify");
					$('#link_desc').removeAttr("lay-verify");
					$('#link_pic').removeAttr("lay-verify");
					$('#link_url').removeAttr("lay-verify");
					$('#vioce_url').removeAttr("lay-verify");
					$('#video_url').removeAttr("lay-verify");
					$('#file_url').removeAttr("lay-verify");
					$('#miniprogram_page').removeAttr("lay-verify");
					$('#miniprogram_name').removeAttr("lay-verify");
					$('#miniprogram_appid').removeAttr("lay-verify");
					$('#miniprogram_title').removeAttr("lay-verify");
					$('#miniprogram_pic').removeAttr("lay-verify");
					$('#lat').removeAttr("lay-verify");
					$('#lng').removeAttr("lay-verify");
					$('#position_address').removeAttr("lay-verify");
					$('#position_detail').removeAttr("lay-verify");
					$('#downText').attr("lay-verify","required");
					$('#topText').attr("lay-verify","required");
					$('#minText').attr("lay-verify","required");
		        	$(".publicHide_content").hide();
		        	$("#menuDiv").show();
		        }else if("{$keyword->type}" == "9"){
					$('#text_content').removeAttr("lay-verify");
					$('#image').removeAttr("lay-verify");
					$('#link_title').removeAttr("lay-verify");
					$('#link_url').removeAttr("lay-verify");
					$('#link_desc').removeAttr("lay-verify");
					$('#link_pic').removeAttr("lay-verify");
					$('#vioce_url').removeAttr("lay-verify");
					$('#video_url').removeAttr("lay-verify");
					$('#miniprogram_page').removeAttr("lay-verify");
					$('#miniprogram_name').removeAttr("lay-verify");
					$('#file_url').removeAttr("lay-verify");
					$('#miniprogram_appid').removeAttr("lay-verify");
					$('#miniprogram_title').removeAttr("lay-verify");
					$('#miniprogram_pic').removeAttr("lay-verify");
					$('#topText').removeAttr("lay-verify");
					$('#downText').removeAttr("lay-verify");
					$('#minText').removeAttr("lay-verify");
					$('#lat').attr("lay-verify","required");
					$('#lng').attr("lay-verify","required");
					$('#position_address').attr("lay-verify","required");
					$('#position_detail').attr("lay-verify","required");
		        	$(".publicHide_content").hide();
		        	$("#positionDiv").show();
		        }
			}
		}
	</script>
	<script type="text/javascript">
		var mycars=new Array();
		mycars[0] = 0;
		if("{$count}"){
			for (var i = 0; i < "{$count}"; i++) {
				mycars[i] = i;
			}
		}
		$('body').on('click','.removeList',function(){
			var id = $(this).data("id");
			mycars.splice($.inArray(id,mycars),1);
			$(this).parent().parent().remove();
		})
		$('body').on('click','.addKeywordMenuList_AddButton',function(){
			var leng = $(".addKeywordMenuList_left_continaer").length;
			mycars[leng] = leng;
			$('.addKeywordMenuList_continaer').append('<li><div class="addKeywordMenuList_left_continaer"><div class="addKeywordMenuList_leftSelect_continaer"><select name="menuType'+leng+'" lay-filter="menuType"><option value="0">点击菜单</option><option value="1">跳转网址</option></select></div><div class="addKeywordMenuList_leftInput_continaer"><div class="layui-input-block inputMenuName"style="width: 300px; margin-left: 20px;"><input type="text"name="minText'+leng+'"required  lay-verify="required" value=""placeholder="请输入内容"autocomplete="off"class="layui-input"></div><div class="layui-input-block inputMenuLink"style="width: 300px; margin-left: 20px; display:none;"><input type="text"name="topurl'+leng+'" required value=""placeholder="请输入网址"autocomplete="off"class="layui-input"></div></div></div><div class="addKeywordMenuList_right_continaer"><button type="button"class="layui-btn layui-btn-danger removeList" data-id="'+leng+'">删除</button></div></li>')
			renderForm()
		})
		function renderForm(){
		 layui.use('form', function(){
		  var form = layui.form;//高版本建议把括号去掉，有的低版本，需要加()
		  form.render();
		 });
		}
	</script>
	<script type="text/javascript">
		// 表单
		layui.use(['form','upload'], function(){
			var form = layui.form;
			var upload = layui.upload;
			//执行实例
		  var uploadVioce = upload.render({
		    accept: 'file'
			,field: 'file'
		    ,elem: '#uploadVioce' //绑定元素
		    ,url: 'upload_file.html' //上传接口
		    ,done: function(res){
		      	layer.msg(res.msg);
				if(res.status == 'success'){
					$('#vioce_url').val(res.data.fileName);
					$('#vioce_name').val(res.data.fileName);
					$('#vioce_name_show').html(res.data.fileName);
				}
		    }
		    ,error: function(){
		      //请求异常回调
		    }
		  });
		   //执行实例
		  var uploadVideo = upload.render({
		    accept: 'file'
			,field: 'file'
		    ,elem: '#uploadVideo' //绑定元素
		    ,url: 'upload_file.html' //上传接口
		    ,done: function(res){
		      	layer.msg(res.msg);
				if(res.status == 'success'){
					$('#video_url').val(res.data.fileName);
					$('#video_name').val(res.data.fileName);
					$('#video_name_show').html(res.data.fileName);
				}
		    }
		    ,error: function(){
		      //请求异常回调
		    }
		  });
		   //执行实例
		  var uploadFile = upload.render({
		    accept: 'file'
			,field: 'file'
		    ,elem: '#uploadFile' //绑定元素
		    ,url: 'upload_file.html' //上传接口
		    ,done: function(res){
		      	layer.msg(res.msg);
				if(res.status == 'success'){
					$('#file_url').val(res.data.fileName);
					$('#file_name').val(res.data.fileName);
					$('#file_name_show').html(res.data.fileName);
				}
		    }
		    ,error: function(){
		      //请求异常回调
		    }
		  });
		  //监听提交
		  form.on('submit(addAutomatictag)', function(data){
		  	if(!data.field.fuzzyMatch && !data.field.preciseMatch){
		  		tusi('模糊匹配与精准匹配至少有一个值'); return;
		  	}
		  	var formData = $('#addAutomatictag').serialize();
			var formData = formData+"&mycars="+mycars.toString()
		  	let id = $("#id").val();
		  	myAjaxPost(false, true, 'add_keyword.html?id='+id, formData, function (resp) {
		    	console.log(resp);
				if (resp.status == 'success') {
					tusi(resp.msg);
					setTimeout(function(){
						location.href = 'keyword.html';
					},1000);
				}else{
					tusi(resp.msg);
				}
			});
		  });
		  form.on('select(menuType)', function (data) {
		  	console.log(data);
		  	if(data.value == "0"){
		  		$(this).parent().parent().parent().parent().find('.inputMenuLink').hide()
		  	}else if(data.value == "1"){
		  		$(this).parent().parent().parent().parent().find('.inputMenuLink').show()
		  	}
		  })
		  form.on('select(shareType)', function (data) {
                if (data.value == "1") {
					$('#image').removeAttr("lay-verify");
					$('#link_title').removeAttr("lay-verify");
					$('#miniprogram_page').removeAttr("lay-verify");
					$('#miniprogram_name').removeAttr("lay-verify");
					$('#link_url').removeAttr("lay-verify");
					$('#miniprogram_appid').removeAttr("lay-verify");
					$('#miniprogram_title').removeAttr("lay-verify");
					$('#miniprogram_pic').removeAttr("lay-verify");
					$('#topText').removeAttr("lay-verify");
					$('#downText').removeAttr("lay-verify");
					$('#vioce_url').removeAttr("lay-verify");
					$('#video_url').removeAttr("lay-verify");
					$('#file_url').removeAttr("lay-verify");
					$('#link_desc').removeAttr("lay-verify");
					$('#lat').removeAttr("lay-verify");
					$('#lng').removeAttr("lay-verify");
					$('#position_address').removeAttr("lay-verify");
					$('#position_detail').removeAttr("lay-verify");
					$('#minText').removeAttr("lay-verify");
					$('#link_pic').removeAttr("lay-verify");
					$('#text_content').attr("lay-verify","required");
		            $(".publicHide_content").hide();
		            $("#text").show();
		        }else if(data.value == "2"){
					$('#text_content').removeAttr("lay-verify");
					$('#link_title').removeAttr("lay-verify");
					$('#miniprogram_page').removeAttr("lay-verify");
					$('#miniprogram_name').removeAttr("lay-verify");
					$('#minText').removeAttr("lay-verify");
					$('#link_url').removeAttr("lay-verify");
					$('#miniprogram_appid').removeAttr("lay-verify");
					$('#miniprogram_title').removeAttr("lay-verify");
					$('#miniprogram_pic').removeAttr("lay-verify");
					$('#vioce_url').removeAttr("lay-verify");
					$('#video_url').removeAttr("lay-verify");
					$('#topText').removeAttr("lay-verify");
					$('#downText').removeAttr("lay-verify");
					$('#file_url').removeAttr("lay-verify");
					$('#image').attr("lay-verify","required");
					$('#link_desc').removeAttr("lay-verify");
					$('#link_pic').removeAttr("lay-verify");
					$('#lat').removeAttr("lay-verify");
					$('#lng').removeAttr("lay-verify");
					$('#position_address').removeAttr("lay-verify");
					$('#position_detail').removeAttr("lay-verify");
		        	$(".publicHide_content").hide();
		        	$("#imgcontainer").show();
		        }else if(data.value == "3"){
					$('#text_content').removeAttr("lay-verify");
					$('#image').removeAttr("lay-verify");
					$('#miniprogram_page').removeAttr("lay-verify");
					$('#miniprogram_name').removeAttr("lay-verify");
					$('#miniprogram_appid').removeAttr("lay-verify");
					$('#miniprogram_title').removeAttr("lay-verify");
					$('#topText').removeAttr("lay-verify");
					$('#downText').removeAttr("lay-verify");
					$('#miniprogram_pic').removeAttr("lay-verify");
					$('#lat').removeAttr("lay-verify");
					$('#lng').removeAttr("lay-verify");
					$('#position_address').removeAttr("lay-verify");
					$('#position_detail').removeAttr("lay-verify");
					$('#vioce_url').removeAttr("lay-verify");
					$('#video_url').removeAttr("lay-verify");
					$('#file_url').removeAttr("lay-verify");
					$('#link_title').attr("lay-verify","required");
					$('#link_url').attr("lay-verify","required");
					$('#minText').removeAttr("lay-verify");
					$('#link_pic').attr("lay-verify","required");
					$('#link_desc').attr("lay-verify","required");
		        	$(".publicHide_content").hide();
		        	$("#imgtextcontainer").show();
		        }else if(data.value == "4"){
					$('#text_content').removeAttr("lay-verify");
					$('#image').removeAttr("lay-verify");
					$('#link_title').removeAttr("lay-verify");
					$('#link_url').removeAttr("lay-verify");
					$('#vioce_url').removeAttr("lay-verify");
					$('#video_url').removeAttr("lay-verify");
					$('#link_desc').removeAttr("lay-verify");
					$('#link_pic').removeAttr("lay-verify");
					$('#topText').removeAttr("lay-verify");
					$('#downText').removeAttr("lay-verify");
					$('#file_url').removeAttr("lay-verify");
					$('#miniprogram_appid').attr("lay-verify","required");
					$('#miniprogram_title').attr("lay-verify","required");
					$('#lat').removeAttr("lay-verify");
					$('#lng').removeAttr("lay-verify");
					$('#position_address').removeAttr("lay-verify");
					$('#position_detail').removeAttr("lay-verify");
					$('#miniprogram_pic').attr("lay-verify","required");
					$('#minText').removeAttr("lay-verify");
					$('#miniprogram_page').attr("lay-verify","required");
					$('#miniprogram_name').attr("lay-verify","required");
		        	$(".publicHide_content").hide();
		        	$("#xcxcontainer").show();
		        }else if(data.value == "5"){
					$('#text_content').removeAttr("lay-verify");
					$('#image').removeAttr("lay-verify");
					$('#link_title').removeAttr("lay-verify");
					$('#link_url').removeAttr("lay-verify");
					$('#vioce_url').attr("lay-verify","required");
					$('#link_desc').removeAttr("lay-verify");
					$('#link_pic').removeAttr("lay-verify");
					$('#miniprogram_page').removeAttr("lay-verify");
					$('#miniprogram_name').removeAttr("lay-verify");
					$('#video_url').removeAttr("lay-verify");
					$('#topText').removeAttr("lay-verify");
					$('#downText').removeAttr("lay-verify");
					$('#file_url').removeAttr("lay-verify");
					$('#miniprogram_appid').removeAttr("lay-verify");
					$('#lat').removeAttr("lay-verify");
					$('#lng').removeAttr("lay-verify");
					$('#position_address').removeAttr("lay-verify");
					$('#position_detail').removeAttr("lay-verify");
					$('#minText').removeAttr("lay-verify");
					$('#miniprogram_title').removeAttr("lay-verify");
					$('#miniprogram_pic').removeAttr("lay-verify");
		        	$(".publicHide_content").hide();
		        	$("#vioceDiv").show();
		        }else if(data.value == "6"){
					$('#text_content').removeAttr("lay-verify");
					$('#image').removeAttr("lay-verify");
					$('#link_title').removeAttr("lay-verify");
					$('#link_url').removeAttr("lay-verify");
					$('#vioce_url').removeAttr("lay-verify");
					$('#link_desc').removeAttr("lay-verify");
					$('#link_pic').removeAttr("lay-verify");
					$('#video_url').attr("lay-verify","required");
					$('#file_url').removeAttr("lay-verify");
					$('#miniprogram_page').removeAttr("lay-verify");
					$('#miniprogram_name').removeAttr("lay-verify");
					$('#miniprogram_appid').removeAttr("lay-verify");
					$('#topText').removeAttr("lay-verify");
					$('#minText').removeAttr("lay-verify");
					$('#lat').removeAttr("lay-verify");
					$('#lng').removeAttr("lay-verify");
					$('#position_address').removeAttr("lay-verify");
					$('#position_detail').removeAttr("lay-verify");
					$('#downText').removeAttr("lay-verify");
					$('#miniprogram_title').removeAttr("lay-verify");
					$('#miniprogram_pic').removeAttr("lay-verify");
		        	$(".publicHide_content").hide();
		        	$("#videoDiv").show();
		        }else if(data.value == "7"){
					$('#text_content').removeAttr("lay-verify");
					$('#image').removeAttr("lay-verify");
					$('#link_title').removeAttr("lay-verify");
					$('#link_url').removeAttr("lay-verify");
					$('#link_desc').removeAttr("lay-verify");
					$('#link_pic').removeAttr("lay-verify");
					$('#vioce_url').removeAttr("lay-verify");
					$('#video_url').removeAttr("lay-verify");
					$('#file_url').attr("lay-verify","required");
					$('#miniprogram_page').removeAttr("lay-verify");
					$('#miniprogram_name').removeAttr("lay-verify");
					$('#miniprogram_appid').removeAttr("lay-verify");
					$('#miniprogram_title').removeAttr("lay-verify");
					$('#miniprogram_pic').removeAttr("lay-verify");
					$('#minText').removeAttr("lay-verify");
					$('#topText').removeAttr("lay-verify");
					$('#lat').removeAttr("lay-verify");
					$('#lng').removeAttr("lay-verify");
					$('#position_address').removeAttr("lay-verify");
					$('#position_detail').removeAttr("lay-verify");
					$('#downText').removeAttr("lay-verify");
		        	$(".publicHide_content").hide();
		        	$("#fileDiv").show();
		        }else if(data.value == "8"){
					$('#text_content').removeAttr("lay-verify");
					$('#image').removeAttr("lay-verify");
					$('#link_title').removeAttr("lay-verify");
					$('#link_desc').removeAttr("lay-verify");
					$('#link_pic').removeAttr("lay-verify");
					$('#link_url').removeAttr("lay-verify");
					$('#vioce_url').removeAttr("lay-verify");
					$('#video_url').removeAttr("lay-verify");
					$('#file_url').removeAttr("lay-verify");
					$('#miniprogram_page').removeAttr("lay-verify");
					$('#miniprogram_name').removeAttr("lay-verify");
					$('#miniprogram_appid').removeAttr("lay-verify");
					$('#miniprogram_title').removeAttr("lay-verify");
					$('#miniprogram_pic').removeAttr("lay-verify");
					$('#lat').removeAttr("lay-verify");
					$('#lng').removeAttr("lay-verify");
					$('#position_address').removeAttr("lay-verify");
					$('#position_detail').removeAttr("lay-verify");
					$('#downText').attr("lay-verify","required");
					$('#topText').attr("lay-verify","required");
					$('#minText').attr("lay-verify","required");
		        	$(".publicHide_content").hide();
		        	$("#menuDiv").show();
		        }else if(data.value == "9"){
					$('#text_content').removeAttr("lay-verify");
					$('#image').removeAttr("lay-verify");
					$('#link_title').removeAttr("lay-verify");
					$('#link_url').removeAttr("lay-verify");
					$('#link_desc').removeAttr("lay-verify");
					$('#link_pic').removeAttr("lay-verify");
					$('#vioce_url').removeAttr("lay-verify");
					$('#video_url').removeAttr("lay-verify");
					$('#miniprogram_page').removeAttr("lay-verify");
					$('#miniprogram_name').removeAttr("lay-verify");
					$('#file_url').removeAttr("lay-verify");
					$('#miniprogram_appid').removeAttr("lay-verify");
					$('#miniprogram_title').removeAttr("lay-verify");
					$('#miniprogram_pic').removeAttr("lay-verify");
					$('#topText').removeAttr("lay-verify");
					$('#downText').removeAttr("lay-verify");
					$('#minText').removeAttr("lay-verify");
					$('#lat').attr("lay-verify","required");
					$('#lng').attr("lay-verify","required");
					$('#position_address').attr("lay-verify","required");
					$('#position_detail').attr("lay-verify","required");
		        	$(".publicHide_content").hide();
		        	$("#positionDiv").show();
		        }
                
                form.render();
            });

		  form.on('radio(shareuser)', function (data) {
                if ($('#shareuser input[name="shareuser"]:checked').val() == "1") {
                    $("#seleatLable").hide();
					$('#checkUser').removeAttr("lay-verify");
                }else if($('#shareuser input[name="shareuser"]:checked').val() == "2"){
                	$("#seleatLable").show();
					$('#checkUser').attr("lay-verify","required");
                }
                form.render();
            });
		});
		// 弹窗
		layui.use('layer', function(){
			var layer = layui.layer;
		}); 
	</script>
	<script>
		layui.use(['element', 'layer'], function () {
		  var layer = layui.layer;
		});
		$('.select_img').on('click',function  () {
		  var targetId=this.getAttribute('data-target');
		  layer.open({
			title:'图片库',
			type: 2,
			area: ['700px', '450px'],
			fixed: false, //不固定
			maxmin: false,
			content: '/imgLib/lib.html?type=vshop_img&target='+targetId
		  });
		})

		window.uploadImgCallback=function (tgt,url) {
		  console.log('选择图片结果',tgt,url);
		  if(tgt=='image'){
			var inputEle=$('#image');
			var prevEle=$('#pic_image');
			inputEle.val(url);
			prevEle.attr('src',url);
			prevEle.show();
		  }else if(tgt=='link_pic'){
			var inputEle=$('#link_pic');
			var prevEle=$('#pic_link_pic');
			inputEle.val(url);
			prevEle.attr('src',url);
			prevEle.show();
		  }else if(tgt=='miniprogram_pic'){
			var inputEle=$('#miniprogram_pic');
			var prevEle=$('#pic_miniprogram_pic');
			inputEle.val(url);
			prevEle.attr('src',url);
			prevEle.show();
		  }
		};
		</script>
	<!-- 标签部分 -->
	<script type="text/javascript">
		let $div = '<input class="inputLable" type="text" name="" placeholder="输入后回车">';
		$('.add_active').click(function(){
			$(this).next().show();
			$(this).next().focus();
		})
		$(".inputLable").on("keypress",function(event){
			if(event.keyCode == 13){
				// alert('内容是：' + $(this).val());
				let val = $(this).val();
			    $('.inputLable').val('');
			    $('.inputLable').hide();
			    $(this).after("<li><span>"+ val +"</span><svg class='deleteLabel't='1614329734901'class='icon'viewBox='0 0 1024 1024'version='1.1'xmlns='http://www.w3.org/2000/svg'p-id='2344'width='30'height='30'><path d='M604.672 523.776l364.544-364.544c25.088-25.088 25.088-66.048 0-90.624l-2.048-2.048c-12.288-12.288-28.16-18.944-45.568-18.944s-33.28 6.656-45.568 18.944L512 431.616 147.456 66.56c-12.288-12.288-28.16-18.944-45.568-18.944-17.408 0-33.28 6.656-45.568 18.944l-2.048 2.048c-12.288 12.288-19.456 28.16-19.456 45.568s6.656 33.28 18.944 45.568l364.544 364.544L53.76 888.832c-25.088 25.088-25.088 66.048 0 90.624l2.048 2.048c12.288 12.288 28.16 18.944 45.568 18.944 17.408 0 33.28-6.656 45.568-18.944L511.488 616.96l364.544 364.544c12.288 12.288 28.16 18.944 45.568 18.944s33.28-6.656 45.568-18.944l2.048-2.048c12.288-12.288 18.944-28.16 18.944-45.568 0-17.408-6.656-33.28-18.944-45.568L604.672 523.776z'p-id='2345'fill='#fff'></path></svg></li>");
			    let matchType = $(this).parent().prev().attr('id');
			    reset_match_val(matchType);
			}  
		});
		$(".inputLable").blur(function(){
		  $('.inputLable').hide();
		  $('.inputLable').val('');
		});
		$('body').on('click','.deleteLabel',function(){
			let	matchType = $(this).parent().parent().prev().attr('id');
			$(this).parent().remove();
			reset_match_val(matchType);
		})

		function reset_match_val(matchType){
			var matchWords = $("."+matchType+" li span");
			let words = [];
			for (var i = 0, l = matchWords.length; i < l; i++) {
		        words.push($(matchWords[i]).text());
		    }
			$("#"+matchType).val(words);
		}
	</script>
		<script type="text/javascript">
	    var check=0;
	    initssss();
	    function codeAddress() {
	        check=0;
	        var address = document.getElementById("position_address").value;
	        // var address = $("#address").val();
	        
	        //通过getLocation();方法获取位置信息值
	        geocoder.getLocation(address);
	    }
	    function initssss() {
	    var map = new qq.maps.Map(document.getElementById("container"),{
	        // center: new qq.maps.LatLng({$redguest->lat},{$redguest->lng}),
	        center: new qq.maps.LatLng(39.916527,116.397128),//线上正式使用 换成上面的写法（依据实际数据去填此除只是默认值）
	        zoom: 13
	    });
	    citylocation = new qq.maps.CityService({
	        complete : function(results){
	           /* map.setCenter(results.detail.latLng);
	            city.style.display = 'inline';
	            city.innerHTML = '所在位置: ' + results.detail.name;*/
	            console.log(results);
	            $("#position_address").val(results.detail.name); 
	        }
	    });
	    geocoder = new qq.maps.Geocoder({
	        complete : function(result){
	            console.log(result);
	            $("#lat").val(result.detail.location.lat);
	            $("#lng").val(result.detail.location.lng);
	            $("#position_detail").val(result.detail.address); 
	            map.setCenter(result.detail.location);
	            if(check==0){
	                var str=result.detail.location+"";
	                var lengh=str.indexOf(",");
	                var lat=str.substring(0,lengh);
	                var lng=str.substring(lengh+2);
	            }
	        
	            var marker = new qq.maps.Marker({
	                map:map,
	                position: result.detail.location
	            });
	            qq.maps.event.addListener(map, 'click', function(event) {
	            marker.setMap(null);      
	            }); 
	        }
	    });
	    //添加监听事件   获取鼠标单击事件
	    qq.maps.event.addListener(map, 'click', function(event) {
	        check=1;
	        $("#lat").val(event.latLng.lat);
	        $("#lng").val(event.latLng.lng);
	         
	        geocoder.getAddress(event.latLng);
	        citylocation.searchCityByLatLng(event.latLng);
	   
	        var marker=new qq.maps.Marker({
	            position:event.latLng, 
	            map:map
	        });    
	        qq.maps.event.addListener(map, 'click', function(event) {
	             marker.setMap(null);      
	        });
	    });
	}
	</script>
</body>
</html>